package com.shop.result;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class JsonResult <T> {
    //状态码
    private Integer code;
    //返回值消息
    private String msg;
    //具体返回数据
    private T data;
    //数据总数
    private int totalSize;
    private boolean success;

    public JsonResult(){
    }

    public JsonResult (boolean success,T data){
        this.success = success;
        this.data = data;
    }

    public JsonResult (boolean success,String msg){
        this.success = success;
        this.msg = msg;
    }

    public JsonResult (boolean success,T data, String msg){
        this.success = success;
        this.msg = msg;
        this.data = data;
    }

    public JsonResult (boolean success,T data, String msg,int totalSize){
        this.success = success;
        this.msg = msg;
        this.data = data;
        this.totalSize = totalSize;
    }

    public JsonResult (boolean success,T data,int totalSize){
        this.success = success;
        this.data = data;
        this.totalSize = totalSize;
    }

    //按自己的需求可以再继续写构造函数
}
